<%@ page language="java" contentType="text/html; charset=utf8"
	pageEncoding="utf8"%>
<%@taglib uri="http://www.springframework.org/tags" prefix="spring"%>
<%@taglib uri="http://www.springframework.org/tags/form" prefix="form"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf8">
	<title><spring:message code="label.titlePreOrder" /></title>
</head>
<body>

<a href="<c:url value="/" />">
	<spring:message code="label.home" />
</a>
  
<h2><spring:message code="label.titleBaseOrder" /></h2>

<form:form method="post" action="addBaseOrder" commandName="baseOrder">
	<table>
		<tr>
			<td><form:label path="snBaseOrder">
				<spring:message code="label.snBaseOrder" />
			</form:label></td>
			<td><form:input path="snBaseOrder" /></td>
		</tr>
		<tr>
			<td><form:label path="statusBaseOrder">
				<spring:message code="label.statusBaseOrder" />
			</form:label></td>
			<td><form:input path="statusBaseOrder" /></td>
		</tr>
		<tr>
			<td><form:label path="invoice">
				<spring:message code="label.invoice" />
			</form:label></td>
			<td><form:input path="invoice" /></td>
		</tr>
		<tr>
			<td><form:label path="comission">
				<spring:message code="label.comission" />
			</form:label></td>
			<td><form:input path="comission" /></td>
		</tr>
		<tr>
			<td><form:label path="ship">
				<spring:message code="label.ship" />
			</form:label></td>
			<td><form:input path="ship" /></td>
		</tr>	
		<tr>
			<td><form:label path="delivery">
				<spring:message code="label.delivery" />
			</form:label></td>
			<td><form:input path="delivery" /></td>
		</tr>						
		<tr>
			<td colspan="2"><input type="submit"
				value="<spring:message code="label.addbaseorder"/>" /></td>
		</tr>
	</table>
</form:form>



<h3><spring:message code="label.baseorders" /></h3>
<c:if test="${!empty baseOrderList}">
	<table class="data" style="border: 1px solid; border-width:1px;">
		<tr>
			<th><spring:message code="label.snBaseOrder" /></th>
			<th><spring:message code="label.statusBaseOrder" /></th>
			<th><spring:message code="label.invoice" /></th>
			<th><spring:message code="label.comission" /></th>	
			<th><spring:message code="label.ship" /></th>
			<th><spring:message code="label.delivery" /></th>	
			<th></th>
			<th></th>
		</tr>
		<c:url var="saveUrl" value="/krams/main/record/edit?id=${personAttribute.id}" />
		<c:forEach items="${baseOrderList}" var="baseorder">
			<tr>
				<td>${baseorder.snBaseOrder}</td>	
				<td>${baseorder.statusBaseOrder}</td>
				<td>${baseorder.invoice}</td>
				<td>${baseorder.comission}</td>
				<td>${baseorder.ship}</td>
				<td>${baseorder.delivery}</td>	
				<td><a href="edit?id=${baseorder.baseorderId}"><spring:message code="label.edit" /></a></td>					
				<td><a href="deleteBaseOrder/${baseorder.baseorderId}"><spring:message code="label.delete" /></a></td>
				<td><a href="createOrders?id=${baseorder.baseorderId}"><spring:message code="label.createorders" /></a></td>
																		
			</tr>
		</c:forEach>
	</table>
</c:if>

</body>
</html>